<template>
    <van-nav-bar
        :title="title"
        :left-text="leftText"
        :right-text="rightText"
        :fixed="fixed"
        :border="false"
        z-index="100"
        @click-left="onClickLeft"
        @click-right="onClickRight"
    >
        <template #left>
            <v-back />
        </template>
    </van-nav-bar>
</template>

<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({
    name: "v-head",
    emits: [ "clickRight" ],
    props: {
        title:{
            type: String
        },
        leftText:{
            type: String
        },
        rightText:{
            type: String
        },
        fixed:{
            type: Boolean
        }
    },
    methods:{
        onClickLeft() {
            this.$router.back()
        },
        onClickRight() {
            this.emit('clickRight')
        },
    }
})
</script>